- 
        Couldn't load subscription status. 
- Fork 32
🐛Storage: Listing path query grows with number of projects unbounded #8542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛Storage: Listing path query grows with number of projects unbounded #8542
Conversation
| Codecov Report✅ All modified and coverable lines are covered by tests. 
 Additional details and impacted files@@             Coverage Diff             @@
##           master    #8542       +/-   ##
===========================================
- Coverage   80.97%   67.25%   -13.73%     
===========================================
  Files        1833      838      -995     
  Lines       71465    38121    -33344     
  Branches     1344      175     -1169     
===========================================
- Hits        57872    25637    -32235     
+ Misses      13205    12427      -778     
+ Partials      388       57      -331     
 
 Continue to review full report in Codecov by Sentry. 
 🚀 New features to boost your workflow:
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a bug where listing path queries grew unboundedly with the number of projects. The fix removes project_ids from the pagination cursor to prevent it from growing without bounds, since cursors are passed through REST APIs. Instead, the project_ids filter is passed directly as a function parameter with validation to ensure it doesn't exceed reasonable limits.
Key Changes:
- Removed project_idsfrom the pagination cursor structure to prevent unbounded growth
- Added input validation with a maximum length constraint (10,000) on filter_by_project_ids
- Added debug logging for S3 listing cursor operations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description | 
|---|---|
| services/storage/src/simcore_service_storage/utils/simcore_s3_dsm_utils.py | Added debug logging for cursor operations when listing child paths in S3 | 
| services/storage/src/simcore_service_storage/modules/db/file_meta_data.py | Removed project_idsfrom cursor parameters, added validation with max length constraint, and updated references to use the parameter directly | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                services/storage/src/simcore_service_storage/modules/db/file_meta_data.py
          
            Show resolved
            Hide resolved
        
              
          
                services/storage/src/simcore_service_storage/modules/db/file_meta_data.py
          
            Show resolved
            Hide resolved
        
      | 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx!
        
          
                services/storage/src/simcore_service_storage/modules/db/file_meta_data.py
          
            Show resolved
            Hide resolved
        
              
          
                services/storage/src/simcore_service_storage/modules/db/file_meta_data.py
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merci!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍 yes we can sometimes check the join together



What do these changes do?
fixes

that happens when the number of accessible projects grows beyond some number.
details
the cursor pagination parameter was integrating the list of projects to filter with and this growths with the number of projects.
luckily the e2e user projects never get deleted and that is why this started to happen.
the fix
Related issue/s
How to test
Dev-ops